// --src/modules/client/user/routes.js
import { Router } from "express";
import { AuthMiddleware  } from "./../../../core/middleware/auth.js";
import { getUserProfile } from "./controller.js";
import { getUserSchema } from "./schema.js";

const router = Router();
// 添加路由级日志
router.use((req, res, next) => {
  console.log("[clientRoutes] 进入子路由");
  next();
});
// 或者如果只想测试路由注册：
router.get("/test", (req, res) => res.send("Test route works"));
// 客户端用户路由
router.get(
  "/profile",
  AuthMiddleware.authenticate(process.env.JWT_SECRET), // JWT认证
  AuthMiddleware.validate(getUserSchema), // 数据验证
  getUserProfile
);
export default router;
